package me.zhengjie.modules.system.rest;

import io.lettuce.core.dynamic.annotation.Param;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.zhengjie.annotation.Log;
import me.zhengjie.modules.system.domain.Chapterlearnrecord;
import me.zhengjie.modules.system.domain.Student;
import me.zhengjie.modules.system.service.ChapterlearnrecordService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequiredArgsConstructor
@Api(tags = "章节学习记录")
@RequestMapping("/api/chapterlearnrecord")
public class ChapterlearnrecordController {

    private final ChapterlearnrecordService chapterlearnrecordService;

    @Log("更新章节学习记录")
    @ApiOperation("更新章节学习")
    @PostMapping("/updateChapterlearnrecord")
    public ResponseEntity<List<Student>> createChaptercomplete(@Validated @RequestBody Chapterlearnrecord chapterlearnrecord) {

        chapterlearnrecordService.updateChapterlearnrecord(chapterlearnrecord);
        return new ResponseEntity<>(HttpStatus.OK);
    }


    //每天更新学习记录

    //资源完成
    //教材完成
}
